package com.otp.service.util;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;

public class ByteArrayToPDF {
	
	public static void bytesToFile(byte[] data, String fileName){

		BufferedOutputStream bs = null;

		try {
		    FileOutputStream fs = new FileOutputStream(new File(fileName));
		    bs = new BufferedOutputStream(fs);
		    bs.write(data);
		    bs.close();
		    bs = null;

		} catch (Exception e) {
		    e.printStackTrace();
		}

		if (bs != null) try { bs.close(); } catch (Exception e) {}
	}// end method bytesToFile
}
